import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
// import txs from '../views/txs/txsView.vue'
// import blocks from '../views/blocks/blocksView.vue'

// console.log(import.meta.env.BASE_URL)

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
      meta: {
        keepAlive: true
      },
    },
    {
      path: '/txs',
      name: 'txs',
      component: () => import('../views/txs/txsView.vue'),
      meta: {
        keepAlive: true
      },
    },
    {
      path: '/token/:id',
      name: 'token',
      component: () => import('../views/token/tokenView.vue'),
    },
    {
      path: '/tx/:id',
      name: 'tx',
      component: () => import('../views/tx/txView.vue'),
    },
    {
      path: '/blocks',
      name: 'blocks',
      component: () => import('../views/blocks/blocksView.vue'),
      meta: {
        keepAlive: true
      },
    },
    {
      path: '/tokentxns',
      name: 'tokentxns',
      component: () => import('../views/tokentxns/tokentxnsView.vue'),
      meta: {
        keepAlive: true
      },
    },
    {
      path: '/error',
      name: 'error',
      component: () => import('../views/notfound/404.vue')
    },
    {
      path: '/block/:id',
      name: 'block',
      component: () => import('../views/block/blockView.vue'),
      meta: {
        keepAlive: true
      }
    },
    {
      path: '/address/:id',
      name: 'address',
      component: () => import('../views/address/addressView.vue'),
      meta: {
        keepAlive: true
      }
    },
    {
      path: '/verifyContract',
      name: 'verifyContract',
      component: () => import('../views/verifyContract/verifyContract.vue')
    },
    {
      path: '/verifyContractsolc',
      name: 'verifyContractsolc',
      component: () => import('../views/verifyContract/verifyContractsolc.vue')
    },
  ]
})

export default router
